package logic;

/**
 * Created with IntelliJ IDEA.
 * User: nocturne
 * Date: 03.03.13
 * Time: 20:18
 * To change this template use File | Settings | File Templates.
 */
public class Controller {

    private SerialWriter serialWriter;

    public Controller() {

        serialWriter = new SerialWriter();

        try {
            //serialWriter.connect("COM20");
            serialWriter.connect("/dev/ttyS80");  //  /dev/ttyACM0       (sudo ln -s /dev/ttyACM0 /dev/ttyS80)
        } catch (Exception e) {
            System.out.println("SerialWriter connect " + e);
        }

    }

    /**
     * Get response Arduino
     * @return
     */
    public String getResponseArduino() {
        return "НУЖНО РЕАЛИЗОВАТЬ!!!";
    }

    /**
     * Enable LED1
     */
    public void onLED1() {
        serialWriter.run("1");
    }

    /**
     * Disable LED1
     */
    public void offLED1() {
        serialWriter.run("0");
    }

    /**
     * Enable LED2
     */
    public void onLED2() {
        serialWriter.run("3");
    }

    /**
     * Disable LED2
     */
    public void offLED2() {
        serialWriter.run("2");
    }


}
